﻿@model List<Urna_TP.Models.Candidato>

@{
    var total = Model.Sum(o => o.Urna.Count());
    var script = "";
}

@foreach (var item in Model)
{

    <div style="float:left;width:200px">@item.Nombre</div>
    <div id="@item.ID" style="float:left;width:500px"><progress value="@(item.CantVotos*100 / total)" max="100"></progress></div>

    <div>@Html.Raw((item.Urna.Count * 100 / total).ToString() + "%")</div>
    <div class="clearBoth"></div>

}

<script> 
    setInterval(Report, 20000)
    $(document).ready function(){!Report();
        function Report()}
        $.get("/Home/Report", function(data){$("#Report").html(data);
</script>
